#ifndef MY_CALL_H
#define MY_CALL_H

#include <QDebug>
#include <pjsua2.hpp>
#include <iostream>
#include <QMetaObject>
#include <QMetaType>

using namespace pj;
using namespace std;

typedef struct{
    AudioMediaPlayer player;
    AudioMedia destinationAudMedia;
    bool   isPlayerCreate;
    bool   isDestinationAudMediaGet;
}PlayWavStruct;

class MyCall : public QObject,public Call
{
    Q_OBJECT
public:
    MyCall(Account &acc,int call_id = PJSUA_INVALID_ID,QObject *parent = nullptr)
    :QObject(parent),Call(acc, call_id)
    {

    }

    ~MyCall();

     OnInstantMessageParam iprmDefault;

     PlayWavStruct remoteWavPlayerS;

     bool isInitativeCall;

     void stopSendMusic(void);

     void startSendMusic(void);

    // Notification when call's state has changed.
    virtual void onCallState(OnCallStateParam &prm);

    // Notification when call's media state has changed.
    virtual void onCallMediaState(OnCallMediaStateParam &prm);

    virtual void onInstantMessage(OnInstantMessageParam &prm);
private:

signals:
    void EOnCallStateOver(void);

    void EOnCallMediaState(void);

    void EOnInstantMessage(OnInstantMessageParam* prm);

};


#endif // MY_CALL_H
